<style>
	.fui-page{background:#f2f2f2}
    .fui-cell-group{width:100%;border-radius: 0.5rem;}
    .fullback-title{color:#999999;font-size:0.7rem;padding:0.75rem 0 0.5rem 0;}
    .fullback-info{}
    .fullback-info p{height:1rem;line-height: 1rem;font-size:0.625rem;color:#333;display: inline-block;padding:0 0.5rem 0 0;}
    .fullback-info p i{border:none;height:0.75rem;width:0.75rem;display: inline-block;background: #ff4753;color:#fff;font-size:0.4rem;line-height: 0.8rem;text-align: center;
        font-style: normal;border-radius: 0.75rem;-webkit-border-radius: 0.75rem;margin-right:0.25rem;}
    .fullback-remark{line-height: 1rem;font-size:0.6rem;color:#666;padding:0.2rem 0;}
	.fui-tab:after {
		height: 0;
	}
	.fui-content {background:#fff}
.popup .popup-body img{
    width: auto;
    height:  auto;
}
</style>
<div ng-if="pagedata.showgoodsdetail" class="popup" style="z-index:1008">
	<div class="popup-body">
		<div class="popup-center" style="border-radius:0.3rem">
		<div style="height:25rem;overflow-y:auto;border-radius:0.3rem;padding-bottom:3rem">
			<i ng-if="pagedata.isfromcart!=1" ng-click="pagedata.showgoodsdetail=false" class="icon icon-close" style="top:-0.8rem;right:-0.5rem" id="alert-click"></i>
			<i ng-if="pagedata.isfromcart==1" ng-click="pagedata.showgoodsdetail=false;pagedata.upcartlist();" class="icon icon-close" style="top:-0.8rem;right:-0.5rem" id="alert-click"></i>
			<!-- 顶部导航 下滑动显示 -->
			<div class="fui-header" style="position: fixed;border-radius:0.3rem">
				<div class="title">
					<div id="tab" class="fui-tab fui-tab-danger" style="border-radius:0.3rem">
						<a ng-class="{'tab':1, 'active':pagedata.showtype == 0}" href="javascript:" ng-click="pagedata.showtype = 0">商品</a>
						<a ng-class="{'tab':1, 'active':pagedata.showtype == 1}" href="javascript:" ng-click="pagedata.showtype = 1">详情</a>
						<a ng-class="{'tab':2, 'active':pagedata.showtype == 2}" href="javascript:" ng-click="pagedata.showtype = 2">参数</a>
					</div>
				</div>
			</div>
			<!--商品详情已完成-->
			<div ng-if="pagedata.showtype ==1" ng-class="{'fui-content detail-block':1,'notbuy':!pagedata.goodsitem.goods.canbuy}">
				<div class="content-block content-images" style="padding:0.2rem 0.3rem" ng-bind-html="trust(pagedata.goodsitem.goods.content)"></div>
			</div>

			<!--参数已完成-->
			<div  ng-if="pagedata.showtype ==2"  ng-class="{'fui-content param-block in':1,'notbuy':!pagedata.goodsitem.goods.canbuy}" style="margin-top:0">
				<div class="fui-cell-group notop">
					<div ng-repeat="p in pagedata.goodsitem.goods.param" class="fui-cell">
						<div class="fui-cell-label md" >{{p.title}}</div>
						<div class="fui-cell-info overflow md">{{p.value}}</div>
					</div>
				</div>
				<div class='content-empty' ng-if="pagedata.goodsitem.goods.param.length<1">
					<i class='icon icon-pingjia1'></i><br/>商品没有参数
				</div>
		</div>
		<!-- 商品其他开始 -->
		<div ng-if="pagedata.showtype==0" ng-class="{'fui-content basic-block pulldown':1, 'notbuy':pagedata.goodsitem.goods.canbuy}" style="top: 0.0rem;padding-bottom:0">
		<i ng-if="pagedata.goodsitem.goods.qrcodeshare > 0" class="icon icon-qrcode" id="alert-click"></i>
		<!--轮播图-->
		<div id="carousel-container2" class="carousel slide" data-role="carousel" data-param-auto="true">
			<div ng-if="!pagedata.goodsitem.goods.video || pagedata.isvideo!=1" class="carousel-inner" role="listbox" style="min-height:13rem;max-height:20rem">
				<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.goodsitem.images">
					<a href="#">
						<img ng-src="{{tomedia(item) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
			<div ng-if="!pagedata.goodsitem.goods.video || pagedata.isvideo!=1" id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
				<div class="fui-swipe-bullet" ng-repeat="item in pagedata.goodsitem.images" ng-class="{'active':$index==0}" data-target="#carousel-container2" data-slide-to="{{$index}}"></div>
			</div>
			<video ng-if="pagedata.goodsitem.goods.video && pagedata.isvideo==1" style="width:100%;height:20rem" ng-src="{{tomedia(pagedata.goodsitem.goods.video)}}" poster="{{tomedia(pagedata.goodsitem.goods.image)}}" x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto"  preload="auto" controls loop="loop">
			</video>
			<!--商品活动，此处加载商品活动展示页-->
			<div ng-if="pagedata.goodsitem.item.active_url" ng-include="pagedata.goodsitem.item.active_url"></div>
		</div>
		<div ng-if="pagedata.goodsitem.goods.video" class="isvideo">
				<div style="width:6rem;margin:0 auto;">
				<span ng-class="{'videobtn':1,'active':pagedata.isvideo==1}" ng-click="pagedata.isvideo=1"><i class="icon icon-shipin1" style="font-size:0.55rem"></i> 视频</span>
				<span ng-class="{'videobtn':1,'active':pagedata.isvideo!=1}" ng-click="pagedata.isvideo=0" style="margin-left:0.5rem;"><i class="icon icon-lunbo" style="font-size:0.5rem;"></i> 图片</span>
				</div>
		</div>
		<div ng-if="pagedata.goodsitem.goods" class="fui-cell-group fui-detail-group" style="padding-bottom:8px">
		<!--秒杀完成-->
		<div ng-if="pagedata.goodsitem.goods.seckillinfo" ng-class="{'seckill-container':1,'notstart':pagedata.goodsitem.goods.seckillinfo.status==1}"
			 data-starttime="{{pagedata.goodsitem.goods.seckillinfo.starttime}}"
			 data-endtime="{{pagedata.goodsitem.goods.seckillinfo.endtime}}"
			 data-status="{{pagedata.goodsitem.goods.seckillinfo.status}}">
			<div class="fui-list seckill-list" style="" >
				<div class="fui-list-media seckill-price">
					&yen;<span>{{pagedata.goodsitem.goods.seckillinfo.price}}</span>
				</div>
				<div class="fui-list-inner">
						<div ng-if="pagedata.goodsitem.goods.seckillinfo.tag" class="text">
							<span class="stitle" style="white-space:nowrap; overflow:hidden; max-width:2.6rem;">{{pagedata.goodsitem.goods.seckillinfo.tag}}</span>
						</div>
					<div class="text"><span class="oldprice">&yen;{{pagedata.goodsitem.goods.minprice}}</span></div>
				</div>
			</div>
			<div class="fui-list seckill-list1" >
				<div class="fui-list-inner">
					<div class="text " ng-if="pagedata.goodsitem.goods.seckillinfo.status==0">已出售 {{pagedata.goodsitem.goods.seckillinfo.percent}}%</div>
					<div class="text " ng-if="pagedata.goodsitem.goods.seckillinfo.status==0"><span class="process"><div class="inner" style="width:{{pagedata.goodsitem.goods.seckillinfo.percent}}%"></div></span></div>
				</div>
			</div>
			<div class="fui-list seckill-list2" style="" >
				<div class="fui-list-inner">
					<div ng-if="pagedata.goodsitem.goods.seckillinfo.status==1" class="text ">距开始还有</div>
					<div ng-if="pagedata.goodsitem.goods.seckillinfo.status!=1" class="text ">距结束还有</div>
					<div class="text timer">
						<span class="time-hour">-</span>&nbsp;:&nbsp;<span class="time-min">-</span>&nbsp;:&nbsp;<span class="time-sec">-</span>
					</div>
				</div>
			</div>
		</div>
		 <!--正常价格-->
			<div class="fui-cell">
				<div class="fui-cell-text" >
					<span ng-if="pagedata.goodsitem.goods.active.title" class="red">{{pagedata.goodsitem.goods.active.title}}</span>
					<span ng-if="pagedata.goodsitem.goods.active.price" class="price"> &yen;{{pagedata.goodsitem.goods.active.price ||'0.00'}}</span>
					<span ng-if="!pagedata.goodsitem.goods.active.price" class="price"> &yen;{{pagedata.goodsitem.goods.price ||'0.00'}}</span>
					<span ng-if="pagedata.goodsitem.goods.originalprice" class="delete" style="margin-left:0.3rem"> &yen;{{pagedata.goodsitem.goods.originalprice}}</span>
				</div>
				<div class="fui-cell-remark noremark lover">
					<i href="javascript:;" ng-click="pagedata.setlike();toogle(pagedata.goodsitem,'islike')" ng-class="{'icon jinyunicon':1,'icon-follow':pagedata.goodsitem.islike !=1,'icon-xiai':pagedata.goodsitem.islike >0}"></i>
				</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-tag">
					<i ng-if="pagedata.goodsitem.goods.ispresell == 1" class="fui-tag fui-tag-red">预</i>
					<i ng-if="pagedata.goodsitem.goods.ispresell != 1" class="fui-tag fui-tag-red">{{pagedata.goodsitem.goods.merchid>0 ? '商户':'自营'}}</i>
				</div>
				<div class="fui-cell-text name bold" style="">
					 {{pagedata.goodsitem.goods.title}}
				</div>
			</div>
			<div class="fui-cell goods-subtitle">
					<span class='text-block'>{{pagedata.goodsitem.goods.subtitle}}</span>
			</div>
			<div ng-if="pagedata.goodsitem.goods.isshowtotal==1" class="fui-cell goods-subtitle" style="margin-top:-.2rem">
					<span class='text-block'>库存：{{pagedata.goodsitem.goods.total}}</span>
			</div>
		</div>
		<!-- 所有营销 -->
		<div class="fui-cell-group fui-sale-group" style="margin-top:0">
			<!-- 商品可用优惠券 -->
			<div class="fui-cell" ng-if="pagedata.goodsitem.sale==1 && pagedata.goodsitem.coupons.lenght >0" ng-include="sys_html('goods/common/_coupons','','','jy_weishop')"></div>
			<!-- 会员等级 -->
			<div ng-if="pagedata.goodsitem.sale==1 && pagedata.goodsitem.isdiscount == 1 && pagedata.goodsitem.level.memberprice != pagedata.goodsitem.goods.minprice && pagedata.goodsitem.member.level" ng-include="sys_html('goods/common/_memberdiscount','','','jy_weishop')"></div>
			<!--已选参数-->
			<div ng-if="pagedata.goodsitem.selespename" class="fui-cell">
				<div class="fui-cell-label" style="width:2rem">已选</div>
				<div class="fui-cell-text bold" style="color:#333">
					{{pagedata.goodsitem.selespename}}{{pagedata.goodsitem.post.num}}件
				</div>
				<div class="fui-cell-remark noremark" ng-click="pagedata.showpicker=true"><i class="icon jinyunicon icon-icon-test"></i></div>
			</div>
			<!--赠品-->
			<div ng-if="pagedata.goodsitem.gifts && pagedata.goodsitem.gifts.total >0" class="fui-cell fui-sale-cell sendgoods">
				<div class="fui-cell-label" style="width:2rem">赠品</div>
					<div ng-if="pagedata.goodsitem.gifts.lenght>1" class="fui-cell-text fui-cell-giftclick">
						<label id="gifttitle">请选择赠品</label>
						<input type="hidden" name="giftid" id="giftid" value="">
					</div>
						<div ng-if="pagedata.goodsitem.gifts.lenght<2" ng-repeat="gi in pagedata.goodsitem.gifts" class='fui-cell-text' ng-click="access_json('jy_weishop/goods/gift//id='+item.id)">
							{{gi.title}}<input type="hidden" name="giftid" id="giftid" value="{{gi.id}}">
						</div>
				<div class="fui-cell-remark noremark"><i class="icon jinyunicon icon-icon-test"></i></div>
			</div>
		</div>
		</div>
		<div ng-if="pagedata.isfromcart==1" class="fui-navbar" style="border-bottom-left-radius: 0.5rem;border-bottom-right-radius: 0.5rem;">
			<a ng-if="!pagedata.selespename && pagedata.goods.canbuy" href="javascript:;" ng-click="pagedata.pickeraddtocart()" class="nav-item btn cartbtn" style="border-radius: 0.5rem;">
				<div ng-class="{'fee-tag-nav':pagedata.isfromcart!=1,'fee-tagup-nav':pagedata.isfromcart==1}">
					加入购物车
				</div>
			</a>
			<a ng-if="pagedata.selespename && pagedata.goods.canbuy" href="javascript:;" ng-click="pagedata.showpicker=true" class="nav-item btn cartbtn" style="border-radius: 0.5rem;">
				<div ng-class="{'fee-tag-nav':pagedata.isfromcart!=1,'fee-tagup-nav':pagedata.isfromcart==1}">
					选择规格
				</div>
			</a>
			<a ng-if="!pagedata.goods.canbuy" class="nav-item btn cartbtn" style="border-radius: 0.5rem;">
				<div class="fee-disabled-nav">
					{{pagedata.goodsitem.goods.nobuytitle}}
				</div>
			</a>
		</div>
	</div>
	</div>
</div>
		<script type="text/javascript">
		scope.pagedata.canAddCart=1;
		//获取关注
		scope.pagedata.setlike=function(){
			scope.post_json('jy_weishop/goods.detail/like/',{},function(){
				if(scope.pagedata.goodsitem.islike==1){
					scope.message('关注成功！');
				}else{
					scope.message('取消成功！');
				}
			});
			
		}
		scope.pagedata.getgoodsdetail=function(goodsid){
			scope.pagedata.showgoodsdetail=true;
			scope.pagedata.goodsitem={};
			scope.pagedata.goods={};
			scope.get('jy_weishop/get_data/getgoodsdetail/id='+goodsid,function(res){
				scope.pagedata.goodsitem=res;
				scope.pagedata.showtype=0;
				scope.pagedata.goods=res.goods;
				scope.pagedata.options=res.options;
				scope.pagedata.selespename=res.selespename;
				scope.pagedata.specs_list=res.specs_list;
				scope.pagedata.post=res.post;
				scope.pagedata.shopset=res.shopset;
				scope.pagedata.goods.id=scope.pagedata.goodsitem.goods.id;
				require(['bootstrap', 'hammer'], function($, Hammer){
					$('#carousel-container2').carousel();
					var mc = new Hammer($('#carousel-container2').get(0));
					mc.on("panleft", function(ev) {
						$('#carousel-container2').carousel('next');
					});
					mc.on("panright", function(ev) {
						$('#carousel-container2').carousel('prev');
					});
				});
				scope.$evalAsync();
			});
		}
		if(scope.pagedata.isfromcart==1){
		//减少
		scope.pagedata.minus=function(){
			if(scope.pagedata.post.num <=1){
				return false;
			}
			scope.pagedata.post.num--;
			scope.$evalAsync();
		}
		//增加
		scope.pagedata.plus=function(){
			if(parseInt(scope.pagedata.goods.usermaxbuy)>0 && parseInt(scope.pagedata.goods.order_goodscount) + parseInt(scope.pagedata.post.num)>=parseInt(scope.pagedata.goods.usermaxbuy)){
				scope.message('不能再加了，你已购买'+scope.pagedata.goods.order_goodscount+'件，超过该商品最大购买量'+scope.pagedata.goods.usermaxbuy+'！','error');
				return false;
			}
			if(parseInt(scope.pagedata.goods.maxbuy)>0 && parseInt(scope.pagedata.post.num)>=parseInt(scope.pagedata.goods.maxbuy)){
				scope.message('不能再加了，超过该商品单次购买'+scope.pagedata.goods.maxbuy+'量！','error');
				return false;
			}
			if(parseInt(scope.pagedata.post.num)>=parseInt(scope.pagedata.options.stock)){
				scope.message('不能再加了，超了库存'+scope.pagedata.options.stock+'啦！','error');
				return false;
			}
			scope.pagedata.post.num++;
			scope.$evalAsync();
		}
		//选择
		scope.pagedata.get_optionsid=function(){
			var specid = scope.pagedata.post.specid;
				specid = specid.join('_');
				scope.post_json('jy_weishop/goods.detail/get_optionsid/',{'specid':specid},function(res){
						console.log(specid);
						scope.pagedata.post.optionsid=res.options.id;
						scope.pagedata.options=res.options;
						scope.pagedata.goods.price=res.options.price;
						scope.pagedata.goods.image=res.options.thumb?res.options.thumb:scope.pagedata.goods.image;
						scope.pagedata.goods.originalprice=res.options.productprice;
						scope.pagedata.selespename=res.selespename;
						scope.$evalAsync();
				});
		}
		scope.pagedata.pickeraddtocart=function(){
			scope.post_json('jy_weishop/goods.detail/addtocart/isres=1',scope.pagedata.goodsitem.post,function (res){
				scope.message('成功加入购物车');
				scope.pagedata.isupdata=1;
				scope.pagedata.showpicker=false
				scope.$evalAsync();
			})
		}
		scope.pagedata.upcartlist=function(){
			if(scope.pagedata.isupdata==1){
				scope.pagedata.isupdata=0;
				scope.pagedata.get_list(true);
			}
		}
		}
		</script>
</div>
<div ng-if="pagedata.showpicker" class="popup" style="z-index:1008">
        <div class="popup-body">
            <div class="popup-bottom">
                <i class="closed icon icon-cuowu" ng-click="pagedata.showpicker=false"></i>
                <div ng-include="sys_html('goods/picker')"></div>
            </div>
        </div>
</div>